package com.ffdms.vo;

import android.database.Cursor;

public class Notice {
	public static final String TABLENAME = "NOTICE";
	public static final String COLUMN_ID = "ID";
	public static final String COLUMN_TITLE = "TITLE";
	public static final String COLUMN_DESCRIPTION = "DESCRIPTION";
	public static final String COLUMN_TIME = "TIME";
	public static final String COLUMN_ENTERPRISEID = "ENTERPRISEID";
	public static final String COLUMN_ADDTIME = "ADDTIME";
	public static final String COLUMN_MODIFYTIME = "MODIFYTIME";
	public static final String[] ALLCOLUMNS = new String[] { COLUMN_ID,
			COLUMN_TITLE, COLUMN_DESCRIPTION, COLUMN_TIME, COLUMN_ENTERPRISEID,
			COLUMN_ADDTIME, COLUMN_MODIFYTIME };
	public static final String CREATE_TABLE_SQL = String.format(
			"CREATE TABLE %s(" + "%s INTEGER PRIMARY KEY AUTOINCREMENT,"
					+ "%s TEXT NULL," 
					+ "%s TEXT NULL," 
					+ "%s TEXT NULL,"
					+ "%s INTEGER NOT NULL," 
					+ "%s TEXT NULL,"
					+ "%s TEXT NULL)", TABLENAME, COLUMN_ID, COLUMN_TITLE,
			COLUMN_DESCRIPTION, COLUMN_TIME, COLUMN_ENTERPRISEID,
			COLUMN_ADDTIME, COLUMN_MODIFYTIME);

	private int iD;
	private String title;
	private String description;
	private String time;
	private int enterpriseID;
	private String addTime;
	private String modifyTime;

	public int getiD() {
		return iD;
	}

	public void setiD(int iD) {
		this.iD = iD;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public int getEnterpriseID() {
		return enterpriseID;
	}

	public void setEnterpriseID(int enterpriseID) {
		this.enterpriseID = enterpriseID;
	}

	public String getAddTime() {
		return addTime;
	}

	public void setAddTime(String addTime) {
		this.addTime = addTime;
	}

	public String getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(String modifyTime) {
		this.modifyTime = modifyTime;
	}
	
	public Notice valueOf(Cursor c){
		this.iD = c.getInt(c.getColumnIndex(Notice.COLUMN_ID));
		this.title = c.getString(c.getColumnIndex(Notice.COLUMN_TITLE));
		this.addTime = c.getString(c.getColumnIndex(Notice.COLUMN_ADDTIME));
		this.description = c.getString(c.getColumnIndex(Notice.COLUMN_DESCRIPTION));
		this.enterpriseID = c.getInt(c.getColumnIndex(Notice.COLUMN_ENTERPRISEID));
		this.modifyTime = c.getString(c.getColumnIndex(Notice.COLUMN_MODIFYTIME));
		this.time = c.getString(c.getColumnIndex(Notice.COLUMN_TIME));
		return this;
	}
}
